-- GENERATED SPELL FOR [Cauldron Lord Malvinious] --


function spell0_11077(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(17173,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_11077', 5000, 1)
end

function spell1_11077(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11077', 3000, 1)
end

function spell2_11077(pUnit, Event) --@Summon Skeleton,Self--
pUnit:FullCastSpellOnTarget(17204,pUnit)
pUnit:RegisterEvent('Sorts_11077', 2000, 1)
end

function Sorts_11077(pUnit, Event)
local choix_sorts_11077 = math.random(0, 2)
if choix_sorts_11077 == 0 then
pUnit:RegisterEvent('spell0_11077', 1, 1)
end
if choix_sorts_11077 == 1 then
pUnit:RegisterEvent('spell1_11077', 1, 1)
end
if choix_sorts_11077 == 2 then
pUnit:RegisterEvent('spell2_11077', 1, 1)
end
end

function mob11077_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11077', math.random(1500, 3000), 1)
end

function mob11077_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11077_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11077_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11077, 1, 'mob11077_Action')
RegisterUnitEvent(11077, 2, 'mob11077_Leave')
RegisterUnitEvent(11077, 3, 'mob11077_Kill')
RegisterUnitEvent(11077, 4, 'mob11077_Die')
